package JunitDemo;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-04-09
 * Time: 10:38
 */

// 断言功能进行判断自动化结果和预期是否相同
public class JunitDemo2 {
    @Test
    public void test() {
        EdgeOptions options = new EdgeOptions();
        options.addArguments("--remote-allow-origins=*");
        EdgeDriver driver = new EdgeDriver(options);
        driver.get("https://www.baidu.com");
        String content = driver.findElement(By.cssSelector("#su")).getAttribute("value");
        Assertions.assertNotEquals("百度一下", content);
        driver.quit();
    }
}
